using System.Linq;
using Ninject;
using Ninject.Modules;
using NinjectSamples.example;
using Xunit;

namespace NinjectSamples
{
	public class ResolveManyOfTypeTests
	{
		[Fact]
		public void When_resolved_Then_there_are_3_instances()
		{
			IKernel kernel = new StandardKernel(new ColourModule());
			
			var colours = kernel.GetAll<IColour>();

			Assert.Equal(3, colours.Count());
		}
	}
	
	public class ColourModule : NinjectModule
	{
		public override void Load()
		{
			Bind<IColour>().To<ColourBlue>();
			Bind<IColour>().To<ColourRed>();
			Bind<IColour>().To<ColourYellow>();

		}
	}
}